package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HmzInventoryMasterMapper;
import com.ruoyi.system.domain.HmzInventoryMaster;
import com.ruoyi.system.service.IHmzInventoryMasterService;

/**
 * 盘点单主Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-31
 */
@Service
public class HmzInventoryMasterServiceImpl implements IHmzInventoryMasterService 
{
    @Autowired
    private HmzInventoryMasterMapper hmzInventoryMasterMapper;

    /**
     * 查询盘点单主
     * 
     * @param id 盘点单主主键
     * @return 盘点单主
     */
    @Override
    public HmzInventoryMaster selectHmzInventoryMasterById(Long id)
    {
        return hmzInventoryMasterMapper.selectHmzInventoryMasterById(id);
    }

    /**
     * 查询盘点单主列表
     * 
     * @param hmzInventoryMaster 盘点单主
     * @return 盘点单主
     */
    @Override
    public List<HmzInventoryMaster> selectHmzInventoryMasterList(HmzInventoryMaster hmzInventoryMaster)
    {
        return hmzInventoryMasterMapper.selectHmzInventoryMasterList(hmzInventoryMaster);
    }

    /**
     * 新增盘点单主
     * 
     * @param hmzInventoryMaster 盘点单主
     * @return 结果
     */
    @Override
    public int insertHmzInventoryMaster(HmzInventoryMaster hmzInventoryMaster)
    {
        hmzInventoryMaster.setCreateTime(DateUtils.getNowDate());
        return hmzInventoryMasterMapper.insertHmzInventoryMaster(hmzInventoryMaster);
    }

    /**
     * 修改盘点单主
     * 
     * @param hmzInventoryMaster 盘点单主
     * @return 结果
     */
    @Override
    public int updateHmzInventoryMaster(HmzInventoryMaster hmzInventoryMaster)
    {
        hmzInventoryMaster.setUpdateTime(DateUtils.getNowDate());
        return hmzInventoryMasterMapper.updateHmzInventoryMaster(hmzInventoryMaster);
    }

    /**
     * 批量删除盘点单主
     * 
     * @param ids 需要删除的盘点单主主键
     * @return 结果
     */
    @Override
    public int deleteHmzInventoryMasterByIds(Long[] ids)
    {
        return hmzInventoryMasterMapper.deleteHmzInventoryMasterByIds(ids);
    }

    /**
     * 删除盘点单主信息
     * 
     * @param id 盘点单主主键
     * @return 结果
     */
    @Override
    public int deleteHmzInventoryMasterById(Long id)
    {
        return hmzInventoryMasterMapper.deleteHmzInventoryMasterById(id);
    }
}
